function RenderManager() {}
RenderManager.prototype = new Entity;

RenderManager.prototype.updateInterval;
RenderManager.prototype.renderInterval;


RenderManager.prototype.init = function()
{
  this.updateInterval = window.setInterval("RTE.RenderManager.update();", 1000 / 100);
  this.renderInterval = window.setInterval("RTE.RenderManager.render();", 1000 / 24);
}


RenderManager.prototype.loadPreset = function()
{
  this.addEntity("Viewport", "Viewport");
  this.addEntity("TileMap", "TileMap");
  this.addEntity("RenderText", "RenderText");

  this.TileMap.loadMap();

  this.RenderText.context = this.Viewport.context;
  this.RenderText.context.font = "20pt Delicious";
}


RenderManager.prototype.update = function()
{
  for (var entityClass in this.entities) {
    for (var i=0; i < this.entities[entityClass].length; i++) {
        this.entities[entityClass][i].update();
    }
  }
  // this.RenderText.text = this.PlayerModel.posX;
}


RenderManager.prototype.render = function()
{
  for (var entityClass in this.entities) {
    for (var i=0; i < this.entities[entityClass].length; i++) {
         this.entities[entityClass][i].render();
    }
  }
}